<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>无标题文档</title>
		<script src="../scripts/jquery-1.3.1.js"></script>
		<script type="text/javascript">
			$(function() {
				//1、获取属性
				var tit = $("h3").attr("title") //获取<h3>标签的"title"属性

				//2、设置属性
				$("h3").attr("title", "我其实不喜欢玩游戏！");

				//3、删除属性
				$("h3").removeAttr("title");

				//包含link的标签的href属性为index.html  title属性为test
				$("a:contains('link')").attr({
					"href": "index.html",
					"title": "test"
				})
				//$("div").attr({ "name": "123", "rel": "456", "title": "789" });
			})
		</script>
	</head>

	<body>
		<h3 title="你最喜欢哪个游戏">你最喜欢哪个游戏？</h3>
		<ol>
			<li title='魔兽世界'>魔兽世界</li>
			<li title='炉石传说'>炉石传说</li>
			<li title='英雄联盟'>英雄联盟</li>
		</ol>

		<h3>例子</h3>
		<a href="#">link1</a>
		<a href="#">link</a>
		<a href="#">lnk</a>
	</body>
</html>
